package com.jqq.homework;

/**
 * @author 姬倩倩
 * @version 1.0
 */
public class Homework07 {
    public static void main(String[] args) {
        new Car(10).getAir().flow();
        new Car(50).getAir().flow();
        new Car(-10).getAir().flow();

    }
}
class Car{
    private double temperature;

    class Air{
        public void flow(){
            if (temperature > 40){
                System.out.println(temperature+" >40 空调吹冷风");
            }else if (temperature < 0){
                System.out.println(temperature+" <0 空调吹热风");
            }else{
                System.out.println(temperature+" 在0-40区间 关闭空调");
            }
        }
    }

    public Air getAir(){
        return new Air();
    }

    public Car(double temperature) {
        this.temperature = temperature;
    }
}
